#pragma once

#include <QBrush>
#include <QColor>
#include <QDebug>
#include <QDesktopServices>
#include <QFont>
#include <QHeaderView>
#include <QMainWindow>
#include <QTableWidget>
#include <QTableWidgetItem>
#include <QUrl>
#include <memory>
#include <string>
#include <vector>
#include <QLabel>
#include "DataMgr.h"
#include "QCheckBox"
#include <QComboBox>

class QLineEdit;
class QPushButton;
class MainWindow;
class WidgetPanel : public QWidget
{
    Q_OBJECT

public:
    WidgetPanel(QWidget *parent = nullptr);

    void setupUI();
    void configToUI();

    QString tagToString(const std::vector<QString> &vecTag);
    QString setToString(const std::unordered_set<QString> &s);

public slots:
    void slotSearchAT();
    void slotSearchATFG();
    void slotBtnLoadWeb();
    void slotSearchCF();
	void slotSearchCFSomeOne();
    void slotSearchTags();
    void slotPrintOther();
    void slotPrintSome();

public:
    QLineEdit *m_edtCFMin;
    QLineEdit *m_edtCFMax;
    QLineEdit *m_edtOtherUser;
    QPushButton *m_btnTag;
    QLabel *m_labelTag;
    QComboBox *m_edtATMin;
    QComboBox *m_edtATMax;
    QLineEdit *m_edtPara;
    QCheckBox *m_checkUseCFTag;
    QPushButton *createSpliterLine();
    MainWindow *m_mainWindw = nullptr;
    DataMgr *m_dataMgr;
    std::vector<std::tuple<ContestType, QCheckBox *>> m_vecCheckContestType;
    std::vector<QCheckBox *> m_vecCheckUser;
};
